%% 模体生成1  beads
Volume = single(rand([750,750,30]));
Volume(Volume <= 0.999995) = 0;
Volume(Volume > 0.999995) = 1;

Volume(:, 375-64:375+64, 15:50) = 0;

Volume(375, 375, 26) = 1;
Volume(375, 375, 31) = 1;
Volume = convn(Volume, ones(5,5,1), 'same');

beads_position = Volume > 0;

plot_V(double(Volume));
%Volume=uint16(Volume/max(Volume(:))*65535*0.66);
%%
Ixy=imadjust(squeeze(max(Volume, [], 3)));
Ixz=imadjust(squeeze(max(Volume, [], 1)));
Iyz=imadjust(squeeze(max(Volume, [], 2)));

Ixz=Ixz';
Iyz=Iyz';

%%
PointsNumber=3;

figure, imshow(Ixy);  axis image;
pts = roi_pick_points(PointsNumber);  %手动选取20个点进行Z轴配准
disp(pts);

%%
bandWidth = 10;

X_list=pts(:,1);
Y_list=pts(:,2);

z_list = pick_z_from_XZ_YZ_concat_rclick_batch(Ixz, Iyz, X_list, Y_list, 10, 'AutoInit', true);

disp(z_list);   % N×1，每个点对对应一个 Z

